import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

class IntCmp implements Comparator<Integer>{
    @Override
    public int compare(Integer o1, Integer o2) {
        return o2-o1;
    }
}

public class d3t3 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入一共有几个元素？进行几次操作？（用空格隔开）");
        String s=scanner.nextLine();
        String[] sarr=s.split(" ");
        int n=Integer.parseInt(sarr[0]);//n个元素
        int k=Integer.parseInt(sarr[1]);//k次操作

        System.out.println("请输入n个正整数：");
        PriorityQueue<Integer> p=new PriorityQueue<>(new IntCmp());//创建大根堆将进行排序
        for (int i = 0; i < n; i++) {
            p.offer(scanner.nextInt());
        }
        //此时元素从大到小排列，取出放入数组
        int[] arr=new int[n];
        int j=0,sum=0;
        for (int i = 0; i < n; i++) {
            arr[i]=p.poll();
            if (j<k && arr[i]%2==0){
               arr[i]/=2;
               j++;
            }
            sum+=arr[i];
        }
        System.out.println(sum);


    }
}
